<% content_for :left_sidebar do %>

<% if logged_in? %>
  <p><strong>You are logged in as <%=h current_user.login %></strong></p>
  <p><%= link_to 'Logout', logout_path %></p>
<% else %>
  <p><strong>You are currently not logged in.</strong></p>
  <p>
    <%= link_to 'Login', login_path %> or
    <%= link_to 'Sign Up', signup_path %>
  </p>
<% end %>

<% end %>

<h2>Hello, 
	<% if current_user.staff_or_student == "staff" %>
	  <%= current_user.title %> <%= user.last_name %>
	<% else %>
	  <%= current_user.first_name %>
	<% end %>
</h2>
	
<% if @roles.include?('admin') %>

    <p><%= link_to 'View/Edit Users', :controller => 'gate', :action => 'index' %></p>
    <p><%= link_to 'Add Students', :controller => 'students', :action => 'new' %></p>
    <p><%= link_to 'View/Edit Students', :controller => 'students', :action => 'index' %></p>
    <p><%= link_to 'View/Edit Projects', :controller => 'projects', :action => 'index' %></p>
    <p><%= link_to 'Allocate Projects', :controller => 'projects', :action => 'allocate' %></p>

<% end %>

<% if @roles.include?('student') %>

  <p>Student</p>
  <p><%= link_to 'My Projects', :controller => 'projects', :action => 'my_projects' %></p>
  <p><%= link_to 'Project List', :controller => 'projects', :action => 'index' %></p>
  <p><%= link_to 'Selection', :controller => 'students', :action => 'choose_projects' %></p>
  
<% end %>

<% if @roles.include?('staff') %>

    <p><%= link_to 'View/Edit my projects', :controller => 'project', :action => 'my_projects' %></p>
    <p><%= link_to 'Create New Project', :controller => 'project', :action => 'new' %></p>

<% end %>

<% if @roles.empty? %>
	<p>Your account is being validated. Please check back later.</p>
<% end %>
